<template>
	<div>
		<el-select class="w-ipt" v-model="c_direction_val" @change="directionChange" placeholder="请选择方向" size="medium">
			<el-option v-for="(item, index) in direction_list" :label="item.name"
				:value="item.value" :key="index"></el-option>
		</el-select>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				direction_list: [{
					value: 'out',
					name: '出'
				}, {
					value: 'in',
					name: '进'
				}],
				c_direction_val: this.direction_val, // 选择的方向值
			}
		},
		props: ['direction_val'],
		watch: {
			direction_val(val) {
				this.c_direction_val = val;
			}
		},
		methods: {
			// 选择了方向,获取设备UUID
			directionChange(val) {
				let self = this;
				self.$emit('getDirectionId', {
					direction_val: val
				})
			},
		}
	}
</script>

<style>
</style>
